Skip to content

Add CableDriverOptions to Submariner CR - #4142

Open
sanek9 wants to merge 2 commits into
submariner-io:develfrom
sanek9:feat/cable-driver-options
Open

Add CableDriverOptions to Submariner CR#4142
sanek9 wants to merge 2 commits into
submariner-io:develfrom
sanek9:feat/cable-driver-options

Conversation

@sanek9

@sanek9 sanek9 commented Jul 20, 2026

Copy link
Copy Markdown

What this PR does / why we need it

Adds cluster-wide spec.cableDriverOptions (map[string]string) on the Submariner CR
and injects it into the gateway as:

SUBMARINER_CABLEDRIVEROPTIONS=<json>

The field is intentionally driver-agnostic: it is an opaque key=value bag that the
selected cable driver may consume. Drivers that do not recognize a key simply ignore it.
That keeps peer-facing Endpoint.BackendConfig unchanged and avoids baking
driver-specific knobs into the CR schema (one field instead of a growing set of
AmneziaWG- / Libreswan- / WireGuard-only API fields).

Today the AmneziaWG driver is the first consumer (obfuscation parameters). The same
mechanism is meant for other drivers later without another CRD change. For Libreswan,
a natural fit would be things discussed in #1668 — for example selecting IKE/ESP
proposals / ciphers so hardware crypto offload can be used — rather than growing the
CR with more Libreswan-specific fields. WireGuard or future drivers can opt in the
same way via cable.GetDriverOptions().

Empty/absent map → env var is not set, so gateways keep built-in driver defaults
(compatible with older submariner images that do not read the variable yet).

More details

Related issues

Related PRs

Checklist

  • CRD / deepcopy updated (config/crd and deploy/crds)
  • OLM bundle CRD/CSV descriptors updated
  • Tests added

@sanek9

sanek9 commented Jul 20, 2026

Copy link
Copy Markdown
Author

Follow-up subctl PR: >>> Creating PR #3: subctl feat/cable-driver-options -> devel
submariner-io/subctl#1830

@submariner-bot

Copy link
Copy Markdown
Contributor

🤖 Created branch: z_pr4142/sanek9/feat/cable-driver-options
🚀 Full E2E won't run until the "ready-to-test" label is applied. I will add it automatically once the PR has 2 approvals, or you can add it manually.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The Submariner API and CRD schemas now support optional driver-specific cable options. The controller serializes non-empty options into SUBMARINER_CABLEDRIVEROPTIONS, with reconciliation coverage for the generated JSON.

Changes

Cable driver options

Layer / File(s) Summary
Options API and schema contract
api/v1alpha1/submariner_types.go, api/v1alpha1/zz_generated.deepcopy.go, config/crd/bases/..., deploy/crds/..., bundle/manifests/..., config/manifests/...
Adds the optional string map, deep-copy handling, CRD schemas, and advanced CSV descriptors.
Gateway environment propagation
internal/controllers/submariner/gateway_resources.go, internal/controllers/submariner/submariner_controller_test.go
Marshals configured options into the gateway environment and verifies the generated JSON value.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: skitt, vthapar, sridhargaddam, oats87

Sequence Diagram(s)

sequenceDiagram
  participant SubmarinerCR
  participant newGatewayPodTemplate
  participant encodingjson
  participant GatewayDaemonSet
  SubmarinerCR->>newGatewayPodTemplate: Provide Spec.CableDriverOptions
  newGatewayPodTemplate->>encodingjson: Marshal options to JSON
  encodingjson-->>newGatewayPodTemplate: Return JSON string
  newGatewayPodTemplate->>GatewayDaemonSet: Set SUBMARINER_CABLEDRIVEROPTIONS
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Actionable Comments Resolved ✅ Passed PASS: the new field, deepcopy, CRD/CSV manifests, gateway env injection, and test coverage are all present, matching the requested follow-ups.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding CableDriverOptions to the Submariner custom resource.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sanek9

sanek9 commented Jul 20, 2026

Copy link
Copy Markdown
Author

Part of the proposal overview: submariner-io/submariner#4101

@sanek9
sanek9 force-pushed the feat/cable-driver-options branch from dbfdbd5 to bc5a983 Compare July 22, 2026 01:53
@submariner-bot submariner-bot added the ready-to-test When a PR is ready for full E2E testing label Jul 27, 2026
@tpantelis

Copy link
Copy Markdown
Contributor

@sanek9 "Bundle validation" job failed which means you need to run make bundle and check in the changes.

Expose cableDriverOptions on the Submariner CR and pass them to
the gateway as SUBMARINER_CABLEDRIVEROPTIONS. Update OLM bundle
manifests for the new field.

Signed-off-by: sanek9 <sanya0996@gmail.com>
@sanek9
sanek9 force-pushed the feat/cable-driver-options branch from 29c9efe to 36572da Compare July 27, 2026 23:13
@tpantelis
tpantelis enabled auto-merge (rebase) July 28, 2026 03:30
@tpantelis
tpantelis disabled auto-merge July 28, 2026 12:39
@tpantelis
tpantelis enabled auto-merge (rebase) July 28, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-test When a PR is ready for full E2E testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants